import { createStore } from 'vuex'

export default createStore({
  state: {
    shop_id: 0,
    user_id: 0,
    is_login: false
  },
  getters: {
    shop_id: state => state.shop_id,
    user_id: state => state.user_id,
    is_login: state => state.is_login
  },
  mutations: {
    set_shop_id(state, shop_id) {
      state.shop_id = shop_id
    },
    set_user_id(state, user_id) {
      state.user_id = user_id
    },
    set_is_login(state, is_login) {
      state.is_login = is_login
    }
  },
  actions: {
    set_shop_id({commit}, shop_id) {
      commit('set_shop_id', shop_id)
    },
    set_user_id({commit}, user_id) {
      commit('set_user_id', user_id)
    },
    set_is_login({commit}, is_login) {
      commit('set_is_login', is_login)
    }
  },
  modules: {
  }
})
